<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:1px;">
	<t:datagrid name="zyOpinionList" checkbox="false" fitColumns="false" title="意见表" onDblClick="dbClickRow"
		actionUrl="zyOpinionController.do?datagrid" idField="id" fit="true" queryMode="group">
		<t:dgCol title="主键"  field="id"  	hidden="true"  queryMode="single"  width="120"></t:dgCol>
		<t:dgCol title="意见"  field="opinion"	queryMode="single"  width="700"></t:dgCol>
		<t:dgCol title="创建人"  field="createName"		queryMode="single"	width="90"></t:dgCol>
		<t:dgCol title="创建时间"  field="createDate"	queryMode="single"	width="130" formatter="yyyy-MM-dd hh:mm:ss"></t:dgCol>
		<t:dgCol title="类型"  field="type"		queryMode="single"	hidden="true"  width="120"></t:dgCol>
		<c:if test="${add eq '1' }">
			<t:dgToolBar title="新增" icon="icon-add" url="zyOpinionController.do?goAdd" funname="add" width="700" height="300"></t:dgToolBar>
		</c:if>
		<t:dgToolBar title="查看" icon="icon-search" url="zyOpinionController.do?goView" funname="goView"></t:dgToolBar>
	</t:datagrid>
	</div>
</div>
<script type="text/javascript">
function goView(){
	var selections = $("#zyOpinionList").datagrid("getSelections");
	if(selections.length < 1){
		tip("请选择一条查看");
		return;
	}
	view(selections[0].id);
}
function dbClickRow(index,row){
	view(row.id);
}
function view(id){
	createdetailwindow("查看意见或建议","zyOpinionController.do?goView&id="+id,700,300);
}
</script>